home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
TEMP
/
GNU
/
bison
/
Stages
< prev
next >
Wrap
Text File
|
1995-06-28
|
1KB
|
39 lines
Stages
Previous: <Bison Parser=>BisonParse> * Next: <Grammar Layout=>GrammarLay> * Up: <Concepts=>Concepts>
#Wrap on
{fH3}Stages in Using Bison{f}
The actual language-design process using Bison, from grammar specification
to a working compiler or interpreter, has these parts:
#Indent +4
1. Formally specify the grammar in a form recognized by Bison
(\*Note <Grammar File=>GrammarFil>: Bison Grammar Files). For each grammatical rule in the language,
describe the action that is to be taken when an instance of that rule
is recognized. The action is described by a sequence of C statements.
2. Write a lexical analyzer to process input and pass tokens to the
parser. The lexical analyzer may be written by hand in C
(\*Note <Lexical=>Lexical>: The Lexical Analyzer Function {fCode}yylex{f}). It could also be produced using Lex, but the use
of Lex is not discussed in this manual.
3. Write a controlling function that calls the Bison-produced parser.
4. Write error-reporting routines.
#Indent
To turn this source code as written into a runnable program, you
must follow these steps:
#Indent +4
1. Run Bison on the grammar to produce the parser.
2. Compile the code output by Bison, as well as any other source files.
3. Link the object files to produce the finished product.
#Indent